Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic recognition - s4647936 #165

Open
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

tranvicky
Copy link

This pull request introduces an Alzheimer's Disease classification solution using Siamese networks on the ADNI dataset. The Siamese Network, with a Simple Classifier, allows for the differentiation between Alzheimer's Disease (AD) and Normal Control (NC) brain images. The primary objective is to use triplet loss and the power of Siamese networks to achieve this classification.

Key Highlights:

  • Implementation of a Siamese network paired with a simple classifier for AD vs. NC classification.
  • The use of the TripletDataset for generating triplets of anchor, positive, and negative images for training.
  • Data augmentation techniques to enhance model robustness during training.
  • Visualisation of embeddings post-training using t-SNE.
  • In-depth analysis using confusion matrices to evaluate the performance of the classifier on test embeddings.

Files Added:

  • train.py: Script containing the Siamese network training logic, visualisation of results, and classifier training.
  • modules.py: Contains the architecture for the Feature Extractor, Siamese Network, Triplet Loss, and the Simple Classifier.
  • dataset.py: Provides the TripletDataset class for generating triplets and the logic for a patient-wise dataset split.
  • predict.py: Script to generate embeddings using the trained Siamese Network, visualise them, and evaluate the classifier's performance.
  • Various plots and figures showcasing the t-SNE visualisations, training vs. validation loss, and confusion matrices.

Setup and Requirements:

  • Requires PyTorch 1.10.1+cu113 or above.
  • Dependencies include torchvision, Pillow, matplotlib, seaborn, numpy, and scikit-learn.
  • Detailed setup, installation, and usage instructions can be found in the README.

Thanks,
Vicky (s4647936)

shakes76 and others added 30 commits September 17, 2023 21:47
… patient), and negative (different class) image triplets for Siamese training.
…d anchor selection and optimized triplet formation for Siamese network training.
…hecking for NaN and Inf values in the dataset
… data, improved triplet selection using patient IDs, and streamlined path extraction using os.path.basename
… flip, and vertical flip) when in train mode
…dded visualization of sample images post-training.
…nd added functionality to save the 2D scatter plot as embeddings_pca.png.
…taset in train.py This will enable subsequent classifier training on Siamese network embeddings.
… and use of labels when processing embeddings post Siamese network training.
…te the classification of Siamese network embeddings into AD or NC categories
…ed embeddings from the Siamese Network. Utilized the Adam optimizer and CrossEntropyLoss for training.
…dings. The accuracy metric is computed to assess the classifier's performance on the test set.
tranvicky and others added 21 commits October 23, 2023 21:21
…lidation losses. This enhancement aids in monitoring the classifier's performance across epochs.
… can now just run the file. Updated with saving all visualising plots.
@nathasha-naranpanawa
Copy link
Collaborator

nathasha-naranpanawa commented Nov 6, 2023

This is an initial inspection, no action is required at this point

Difficulty: Hard

Readme: Very good

  • Clear flow of information
  • Algortihm and usage explained well
  • Relevant plots for loss and 2D manifolds provided

Commit messages: very good, detailed

Code:

  • uses a triplet network
  • good design
  • sufficiently commented

Functionality/Performance:

  • the triplet network seem to have converged but the manifold doesn't look great
  • classifier seem to perform poorly (no accuracy plot/average accuracy for the classfier shown other than the confusion matrix)
  • future work have been suggested but no attempts have been made to improve either sub networks

General comments:

  • PR is in the main branch
  • solves the problem apporpriately although performance is poor
  • one major reason the triplet isn't doing a good job of separating the two classes could be because your feature extracting backbone network isn't strong enough. Could have tried something like a ResNet or VGG to see if it would improve.

@shakes76 shakes76 added the Extension Extension approved label Nov 20, 2023
@shakes76
Copy link
Owner

Marking

Good Practice (Design/Commenting, TF/Torch Usage)

Adequate design and implementation
Good spacing and comments
Header blocks missing -1

Recognition Problem

Solves problem
Driver Script present
File structure present
Shows Usage & Demo & Visualisation & Data usage
Module present
Commenting
No Data leakage
Difficulty: Hard

Commit Log

Meaningful commit messages
Progressive commits used

Documentation

ReadMe acceptable/good
Model/technical explanation
Good Description and Comments
Markdown used and PDF submitted

Pull Request

Successful Pull Request (Working Algorithm Delivered on Time in InCorrect Branch) -2
Feedback required, please change the branch to the correct one, ensure repo READMEs are restored. -2
Request Description good

@shakes76
Copy link
Owner

Feedback marks possible +2 if the requested changes are made (see above).

@shakes76 shakes76 added the question Further information is requested label Nov 20, 2023
@wangzhaomxy
Copy link
Collaborator

No feedback attempt and no feedback marks granted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extension Extension approved question Further information is requested Siamese
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants